// $ANTLR 3.4 C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g 2012-11-09 14:56:48

package PL.prac8;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class JavaParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ACORCHETE", "ALLAVE", "AND", "APARENTESIS", "ASTERISCO", "BARRA", "BLANCO", "BREAK", "CADENA", "CARACTER", "CCORCHETE", "CLLAVE", "COMA", "COMENTARIO", "COMILLA", "COMILLAS", "CPARENTESIS", "DIGITO", "DOSPUNTOS", "ESPACIO", "IDENT", "IF", "IGUAL", "INTERROGANTE", "LETRA", "MAS", "MAYOR", "MENOR", "MENOS", "NOT", "NUEVA_LINEA", "NUMERO", "OR", "ORYACC", "PUNTO", "SEPARADOR", "WHILE"
    };

    public static final int EOF=-1;
    public static final int ACORCHETE=4;
    public static final int ALLAVE=5;
    public static final int AND=6;
    public static final int APARENTESIS=7;
    public static final int ASTERISCO=8;
    public static final int BARRA=9;
    public static final int BLANCO=10;
    public static final int BREAK=11;
    public static final int CADENA=12;
    public static final int CARACTER=13;
    public static final int CCORCHETE=14;
    public static final int CLLAVE=15;
    public static final int COMA=16;
    public static final int COMENTARIO=17;
    public static final int COMILLA=18;
    public static final int COMILLAS=19;
    public static final int CPARENTESIS=20;
    public static final int DIGITO=21;
    public static final int DOSPUNTOS=22;
    public static final int ESPACIO=23;
    public static final int IDENT=24;
    public static final int IF=25;
    public static final int IGUAL=26;
    public static final int INTERROGANTE=27;
    public static final int LETRA=28;
    public static final int MAS=29;
    public static final int MAYOR=30;
    public static final int MENOR=31;
    public static final int MENOS=32;
    public static final int NOT=33;
    public static final int NUEVA_LINEA=34;
    public static final int NUMERO=35;
    public static final int OR=36;
    public static final int ORYACC=37;
    public static final int PUNTO=38;
    public static final int SEPARADOR=39;
    public static final int WHILE=40;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public JavaParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public JavaParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return JavaParser.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g"; }

    boolean inbucle = false;
              boolean encontrado = false;


    // $ANTLR start "entrada"
    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:13:1: entrada returns [boolean e = false] : ( instrucciones )* EOF ;
    public final boolean entrada() throws RecognitionException {
        boolean e =  false;


        try {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:13:36: ( ( instrucciones )* EOF )
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:13:38: ( instrucciones )* EOF
            {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:13:38: ( instrucciones )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==BREAK||LA1_0==IF||LA1_0==WHILE) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:13:39: instrucciones
            	    {
            	    pushFollow(FOLLOW_instrucciones_in_entrada49);
            	    instrucciones();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            match(input,EOF,FOLLOW_EOF_in_entrada53); 

            e=encontrado;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return e;
    }
    // $ANTLR end "entrada"



    // $ANTLR start "instrucciones"
    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:14:1: instrucciones : ( bucle | condicion | sentenciabreak );
    public final void instrucciones() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:14:14: ( bucle | condicion | sentenciabreak )
            int alt2=3;
            switch ( input.LA(1) ) {
            case WHILE:
                {
                alt2=1;
                }
                break;
            case IF:
                {
                alt2=2;
                }
                break;
            case BREAK:
                {
                alt2=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;

            }

            switch (alt2) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:14:16: bucle
                    {
                    pushFollow(FOLLOW_bucle_in_instrucciones61);
                    bucle();

                    state._fsp--;


                    }
                    break;
                case 2 :
                    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:14:22: condicion
                    {
                    pushFollow(FOLLOW_condicion_in_instrucciones63);
                    condicion();

                    state._fsp--;


                    }
                    break;
                case 3 :
                    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:14:32: sentenciabreak
                    {
                    pushFollow(FOLLOW_sentenciabreak_in_instrucciones65);
                    sentenciabreak();

                    state._fsp--;


                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "instrucciones"



    // $ANTLR start "bucle"
    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:15:1: bucle : WHILE comparacion cuerpo ;
    public final void bucle() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:15:6: ( WHILE comparacion cuerpo )
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:15:8: WHILE comparacion cuerpo
            {
            match(input,WHILE,FOLLOW_WHILE_in_bucle71); 

            pushFollow(FOLLOW_comparacion_in_bucle73);
            comparacion();

            state._fsp--;


            inbucle = true;

            pushFollow(FOLLOW_cuerpo_in_bucle76);
            cuerpo();

            state._fsp--;


            inbucle = false;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "bucle"



    // $ANTLR start "condicion"
    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:16:1: condicion : IF comparacion cuerpo ;
    public final void condicion() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:16:10: ( IF comparacion cuerpo )
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:16:12: IF comparacion cuerpo
            {
            match(input,IF,FOLLOW_IF_in_condicion84); 

            pushFollow(FOLLOW_comparacion_in_condicion86);
            comparacion();

            state._fsp--;


            pushFollow(FOLLOW_cuerpo_in_condicion88);
            cuerpo();

            state._fsp--;


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "condicion"



    // $ANTLR start "comparacion"
    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:17:1: comparacion : APARENTESIS IDENT CPARENTESIS ;
    public final void comparacion() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:17:12: ( APARENTESIS IDENT CPARENTESIS )
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:17:14: APARENTESIS IDENT CPARENTESIS
            {
            match(input,APARENTESIS,FOLLOW_APARENTESIS_in_comparacion94); 

            match(input,IDENT,FOLLOW_IDENT_in_comparacion96); 

            match(input,CPARENTESIS,FOLLOW_CPARENTESIS_in_comparacion98); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "comparacion"



    // $ANTLR start "cuerpo"
    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:18:1: cuerpo : ( ALLAVE ( instrucciones )* CLLAVE | instrucciones );
    public final void cuerpo() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:18:7: ( ALLAVE ( instrucciones )* CLLAVE | instrucciones )
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==ALLAVE) ) {
                alt4=1;
            }
            else if ( (LA4_0==BREAK||LA4_0==IF||LA4_0==WHILE) ) {
                alt4=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 4, 0, input);

                throw nvae;

            }
            switch (alt4) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:18:9: ALLAVE ( instrucciones )* CLLAVE
                    {
                    match(input,ALLAVE,FOLLOW_ALLAVE_in_cuerpo104); 

                    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:18:16: ( instrucciones )*
                    loop3:
                    do {
                        int alt3=2;
                        int LA3_0 = input.LA(1);

                        if ( (LA3_0==BREAK||LA3_0==IF||LA3_0==WHILE) ) {
                            alt3=1;
                        }


                        switch (alt3) {
                    	case 1 :
                    	    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:18:16: instrucciones
                    	    {
                    	    pushFollow(FOLLOW_instrucciones_in_cuerpo106);
                    	    instrucciones();

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    break loop3;
                        }
                    } while (true);


                    match(input,CLLAVE,FOLLOW_CLLAVE_in_cuerpo109); 

                    }
                    break;
                case 2 :
                    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:18:40: instrucciones
                    {
                    pushFollow(FOLLOW_instrucciones_in_cuerpo113);
                    instrucciones();

                    state._fsp--;


                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "cuerpo"



    // $ANTLR start "sentenciabreak"
    // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:19:1: sentenciabreak : BREAK SEPARADOR ;
    public final void sentenciabreak() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:19:15: ( BREAK SEPARADOR )
            // C:\\Users\\Jose\\workspace\\prac8\\src\\main\\java\\PL\\prac8\\modulosantlr\\JavaParser.g:19:17: BREAK SEPARADOR
            {
            match(input,BREAK,FOLLOW_BREAK_in_sentenciabreak119); 

            match(input,SEPARADOR,FOLLOW_SEPARADOR_in_sentenciabreak121); 

            if (inbucle) {
                System.out.println("break encontrado dentro de un bucle"); 
                encontrado = true;
                }
            else System.out.println("break NO encontrado dentro de un bucle");

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "sentenciabreak"

    // Delegated rules


 

    public static final BitSet FOLLOW_instrucciones_in_entrada49 = new BitSet(new long[]{0x0000010002000800L});
    public static final BitSet FOLLOW_EOF_in_entrada53 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_bucle_in_instrucciones61 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_condicion_in_instrucciones63 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_sentenciabreak_in_instrucciones65 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WHILE_in_bucle71 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_comparacion_in_bucle73 = new BitSet(new long[]{0x0000010002000820L});
    public static final BitSet FOLLOW_cuerpo_in_bucle76 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IF_in_condicion84 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_comparacion_in_condicion86 = new BitSet(new long[]{0x0000010002000820L});
    public static final BitSet FOLLOW_cuerpo_in_condicion88 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_APARENTESIS_in_comparacion94 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_IDENT_in_comparacion96 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_CPARENTESIS_in_comparacion98 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ALLAVE_in_cuerpo104 = new BitSet(new long[]{0x0000010002008800L});
    public static final BitSet FOLLOW_instrucciones_in_cuerpo106 = new BitSet(new long[]{0x0000010002008800L});
    public static final BitSet FOLLOW_CLLAVE_in_cuerpo109 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_instrucciones_in_cuerpo113 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_BREAK_in_sentenciabreak119 = new BitSet(new long[]{0x0000008000000000L});
    public static final BitSet FOLLOW_SEPARADOR_in_sentenciabreak121 = new BitSet(new long[]{0x0000000000000002L});

}